﻿using System;
using System.Collections.Generic;
using System.Diagnostics.Contracts;
using System.Linq;
using System.Text;
using EuroManager.Domain.Simulator.Helpers;

namespace EuroManager.Domain.Simulator.Engine
{
    [ContractClass(typeof(TimeAwareContract))]
    public interface ITimeAware
    {
        void Update(float elapsedTime);
    }

    [ContractClassFor(typeof(ITimeAware))]
    public abstract class TimeAwareContract : ITimeAware
    {
        public void Update(float elapsedTime)
        {
            Contract.Requires(elapsedTime.IsRational() && elapsedTime > 0);
        }
    }
}
